<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="keywords" content="admin, dashboard, bootstrap, template, flat, modern, theme, responsive, fluid, retina, backend, html5, css, css3">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="#" type="image/png">
    <!--file upload-->
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/bootstrap-fileupload.min.css" />
    <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/bootstrap-fileinput/4.4.2/css/fileinput.min.css " />
    <link href="/Public/Admin/css/style.css" rel="stylesheet">
    <link href="/Public/Admin/css/index.css" rel="stylesheet">
    <link href="/Public/Admin/css/style-responsive.css" rel="stylesheet">
    <link rel="stylesheet" href="/Public/Admin/css/zyUpload.css" type="text/css">

    <title> 七 彩 </title>
    <!-- ie 9 -->
    <script src="/Public/Admin/js/html5shiv.js"></script>
    <script src="/Public/Admin/js/respond.min.js"></script>
    <script src="/Public/Admin/js/jquery-2.0.3.min.js"></script>
</head>
<body class="sticky-header">
    <div class="left-side sticky-left-side">
    <!--logo and iconic logo start-->
    <div class="logo">
        <a href="index.html"><h4> 全 球 自 由 行 </h4></a>
    </div>

    <div class="logo-icon text-center">
        <a href="index.html"><img src="/Public/Admin/images/logo_icon.png" alt=""></a>
    </div>
    <!--logo and iconic logo end-->

    <div class="left-side-inner">
        <ul class="nav nav-pills nav-stacked custom-nav">
            <li class="<?php if((CONTROLLER_NAME) == "Index"): ?>active<?php endif; ?>">
                <a href="/admin/Index/index.html">
                    <i class="fa fa-home"></i><span>主页数据分析</span>
                </a>
            </li>
            <li class="menu-list <?php if((CONTROLLER_NAME) == "Area"): ?>nav-active<?php endif; ?>"><a href=""><i class="fa fa-laptop"></i> <span>地区管理</span></a>
                <ul class="sub-menu-list">
                    <li class="<?php if((ACTION_NAME) == "index"): ?>active<?php endif; ?>"><a href="/admin/Area/index">地区管理</a></li>
                </ul>
            </li>
            <li class="menu-list <?php if((CONTROLLER_NAME) == "City"): ?>nav-active<?php endif; ?>"><a href=""><i class="fa fa-laptop"></i> <span>城市管理</span></a>
                <ul class="sub-menu-list">
                    <li class="<?php if((ACTION_NAME) == "index"): ?>active<?php endif; ?>"><a href="/admin/City/index">城市管理</a></li>
                </ul>
            </li>

            <li class="menu-list"><a href=""><i class="fa fa-file-text"></i> <span>其他页面管理</span></a>
                <ul class="sub-menu-list">
                    <li><a href="404.html"> 404 错误</a></li>
                    <li><a href="500.html"> 500 错误</a></li>
                </ul>
            </li>
            <li><a href="/admin/Login/index.html"><i class="fa fa-sign-in"></i> <span>登录页面</span></a></li>
        </ul>
        <!--sidebar nav end-->

    </div>
    </div>

    <div class="main-content" >
        <div class="header-section">
            <!--toggle button start-->
            <a class="toggle-btn"><i class="fa fa-bars"></i></a>
            <!--toggle button end-->

            <div class="menu-right">
                <ul class="notification-menu">
                    <li>
                        <a href="#" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                            <img src="/Public/admin/images/photos/user-avatar.png" alt="" />
                            <?php echo ($_SESSION['admin']['username']); ?>
                            <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu dropdown-menu-usermenu pull-right">
                            <li><a href="/admin/User/renew?account_id=<?php echo ($_SESSION['admin']['account_id']); ?>"><i class="fa fa-user"></i>  个人信息</a></li>
                            <li><a href="#"><i class="fa fa-cog"></i>  设置</a></li>
                            <li><a href="/admin/Login/outlogin"><i class="fa fa-sign-out"></i> 退出登录</a></li>
                        </ul>
                    </li>
                </ul>
            </div>

        </div>
            
    <section>
        <!-- page heading start-->
        <div class="page-heading">
            <h3>
                区域管理列表
            </h3>
            <ul class="breadcrumb">
                <li class="active"> 区域表</li>
            </ul>
        </div>
        <!-- page heading end-->

        <!--body wrapper start-->
        <div class="wrapper">
            <div class="row">
                <div class="col-sm-12">
                    <section class="panel">
                        <header class="panel-heading">
                            区域管理列表
                    <span class="tools pull-right">
                        <a href="javascript:;" class="fa fa-chevron-down"></a>
                     </span>
                        </header>
                        <div class="panel-body">
                            <div class="adv-table editable-table ">
                                <div class="clearfix">
                                    <div class="btn-group">
                                        <a href="/admin/Area/create" class="btn btn-primary" type="button">
                                            添加新的区域
                                        </a>
                                    </div>
                                </div>

                                <table class="newtable" id="tableAd">
                                    <thead>
                                    <tr>
                                        <th>区域ID</th>
                                        <th >区域名称</th>
                                        <th >区域图片</th>
                                        <th >是否显示</th>
                                        <th >操作</th>
                                    </tr>
                                    </thead>

                                    <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr data-id=<?php echo ($vo["id"]); ?>>
                                            <td><?php echo ($vo["id"]); ?></td>
                                            <td><?php echo ($vo["name"]); ?></td>
                                            <td><img src="<?php echo ($vo["image"]); ?>" alt="区域图片"></td>
                                            <td><?php echo ($vo["is_show"]); ?></td>
                                            <td>
                                                <button type="button"  data-id="<?php echo ($vo["id"]); ?>" class="btn btn-danger btn-xs delete-ad">
                                                    删除
                                                </button>
                                                <button type="button" data-id="" data-state="" data-title="" data-review="" data-pay="" class="btn btn-primary btn-xs update-ad">
                                                    <a style="color:#fff;" href="/Admin/Area/update?id=<?php echo ($vo["id"]); ?>"> 更新</a>
                                                </button>
                                            </td>
                                        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                                </table>
                                <?php echo ($show); ?>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </div>

        <div class="modal fade" id="deleteModel">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">删除提醒</h4>
                    </div>
                    <div class="modal-body">
                        <p>确认删除，删除后无法恢复&hellip;</p>
                    </div>
                    <div class="modal-footer">
                        <input type="hidden" id="adId"/>
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary deleteRemove">确定</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div>
    </section>

        <footer>
            2018 @ <a href="http://www.newdar.org/" target="_blank">七彩玫瑰</a>
        </footer>
        <!--footer section end-->

    </div>
    <!--common-->
</body>



<!--<script src="/Public/Admin/js/jquery-1.10.2.min.js"></script>-->
<script src="/Public/Admin/js/jquery-migrate-1.2.1.min.js"></script>
<script src="/Public/Admin/js/bootstrap.min.js"></script>
<script charset="utf-8" src="https://cdn.bootcss.com/bootstrap-fileinput/4.4.2/js/locales/zh.js"></script>
<script charset="utf-8" src="https://cdn.bootcss.com/bootstrap-fileinput/4.4.2/js/fileinput.min.js "></script>

    <script type="text/javascript">
        $(document).ready(function () {
            $('.delete-ad').on('click',function(){
                var $this=this;
                var id = jQuery($this).data("id");
                $('#adId').val(id);
                $('#deleteModel').modal('show');
            });


            $('.deleteRemove').on('click',function(){
                clearForm();
                var id = $('#adId').val();
                $.ajax({
                    type : "post",
                    url : "/Admin/Area/delete",
                    dataType : 'json',
                    data : {'id':id},
                    success : function (msg)
                    {
                        if (msg.info == 'ok') {
                            window.location.reload();
                            $('#deleteModel').modal('hide');
                        }else{
                            $('#deleteModel').find('.modal-body').append('<div class="alert alert-danger" role="alert">'+ msg.info +'</div>');
                        }
                    }
                });
            });


            /* 清理FORM */
            function clearForm() {
                $('#createModal').find('.alert-danger').remove();
                $('#UpdateModal').find('.alert-danger').remove();
            }
        });

    </script>

<script src="/Public/Admin/js/modernizr.min.js"></script>
<script src="/Public/Admin/js/jquery.nicescroll.js"></script>

<script type="text/javascript" src="/Public/Admin/js/ckeditor/ckeditor.js"></script>


<!--common scripts for all pages-->
<script src="/Public/Admin/js/scripts.js"></script>

</html>